﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using System;
using System.Collections.Generic;

namespace HRM.Migrator
{
    public class HRMDbContext : DbContext
    {
        public HRMDbContext(DbContextOptions<HRMDbContext> options)
            : base(options)
        {

        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            var list = ConfigurationHelper.Get<List<string>>("DomainModelAssemblyNameList");
            foreach (var item in list)
            {
                builder.ExecuteConfigurations(item);
            }
            base.OnModelCreating(builder);
        }

    }
}
